<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:jee="http://java.sun.com/xml/ns/javaee"
	version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:import href="WEB-INF/xlib/xpgj.xsl" />

	<xsl:template match="/" mode="css">
#import-dir-form { overflow: auto; }
#import-dir-form ul { list-style-type: none; }
#import-dir-form li { float: left; width: 10em; }
#import-dir-form li { line-height: 1em; margin-right: 2em; }
li.picked { background-color: yellow; }
	</xsl:template>

	<xsl:template match="/" mode="content">
		<xsl:apply-templates select="*/ImportRootDir"/>
	</xsl:template>

	<xsl:template match="ImportRootDir">
		<div id="import-dir-form">
			<form action="import" method="post">
				<xsl:apply-templates select="." mode="list"/>
				<div class="clr">
					<input type="submit" value="Import"/>
				</div>
			</form>
		</div>
	</xsl:template>

	<xsl:template match="ImportRootDir" mode="list">
		<ul><xsl:apply-templates/></ul>
	</xsl:template>

	<xsl:template match="ImportRootDir/Entry">
		<li>
			<xsl:if test=". = /*/Picked/Entry">
				<xsl:attribute name="class">picked</xsl:attribute>
			</xsl:if>
			<input type="checkbox" name="ent" value="{.}"/>
			<xsl:text> </xsl:text><xsl:apply-templates/>
		</li>
	</xsl:template>

</xsl:stylesheet>
